﻿using System.Reflection;

namespace Borg
{
    public class RegisterEventArgs : SystemEventArgs
    {
        internal readonly SlotInfo slotInfo;
        internal readonly PlugTypeInfo plugTypeInfo;

        public SlotInfo SlotInfo
        {
            get { return slotInfo; }
        }

        public PlugTypeInfo PlugTypeInfo
        {
            get { return plugTypeInfo; }
        }

        public RegisterEventArgs(SlotInfo slotInfo, PlugTypeInfo plugTypeInfo, Assembly initiator)
            : base(initiator)
        {
            this.slotInfo = slotInfo;
            this.plugTypeInfo = plugTypeInfo;
        }

        public T GetParamValue<T>(string name)
        {
            return (T)GetParamValue(name);
        }

        public object GetParamValue(string name)
        {
            return plugTypeInfo.GetParamValue(name);
        }
    }

    public delegate void RegisterEventHandler(object sender, RegisterEventArgs args);
}

